---
title: "IsraelJapan20210128to0203JPN0210ISR"
author: "Atsushi Tago"
date: "2021/2/17"
output:
  html_document: default
  pdf_document: default
  word_document: default
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Overview
Israel and Japan are both parliamentary democracies facing with a similar nuclear threat (Iran and North Korea). The two threatening countries are very hostile toward Israel and Japan respectively and they could be a "mad" enemy (they could be either "rational mad" or "irrational mad" depending how their extraordinary behaviors are framed). The two democracies are very different in terms of the military culture; one is with the national conscription system (Israel) and the other is with widely-known peace constitution and anti-war sentiment among the public (Japan). Two countries have "defense" forces, but they are quite different.  The IDF (Israel) has been fighting actual wars over the decades SDF (Japan) has never engaged in an actual combat after its inception. 

The comparable survey experiments were conducted in Japan and in Israel, both handled by the Nikkei Research. The start day of the survey fielding was January 28th, 2021, and it ended in Japan on February 3rd and in Israel on February 10th, 2021.

We believe that fielding the experiment in Japan and Israel serves as one of the most critical tests of diversionary theory. The two democracies have been recently faced with highly visible political scandals and being under a serious threat of Iran or North Korea.

We asked the respondents to read a mock newspaper article on different madness level of the enemy and potential threat level along with possibility of preemptive attack against it.  Rally around the flag effect (actually, "threat induced support") is observed in Japan (where 43\% of the population considers that the PM is corrupted) but not in Israel (where 72\% of the population considers that the PM is corrupted: the ceiling effect?); no diversionary effect (no diversion to threat/use of force from political scandal). 

An interesting twist exists. Israeli people support preemption by Japanese PM more than when it is done by their own PM against a nuclear threat.


```{r cars, include=FALSE}
rm(list = ls(all.names = F))
library("tidyverse")
library("readr")
library("stringr")
library("ggplot2")
library("ggcorrplot")
library("ggpubr")
library("multcomp")

dfj <- read_csv("Japan.csv")
dfi <- read_csv("Israel.csv")


str(dfj)
str(dfi)

```

## Data mutation
Making the DVs reversed: the larger, the higher support

```{r data mutation, include=TRUE}
#q12b in Japan: Do you support Japanese PM?
dfj <- dfj %>%
  mutate(q12b = 4 - q12b)
table(dfj$q12b)
#q12a in Japan: Do you support Israeli PM?
dfj <- dfj %>%
  mutate(q12a = 4 - q12a)
table(dfj$q12a)
#q12a in Israel: Do you support Israeli PM?
dfi <- dfi %>%
  mutate(Q12a = 4 - Q12a)
table(dfi$Q12a)
#q12b in Israel: Do you support Japanese PM?
dfi <- dfi %>%
  mutate(Q12b = 4 - Q12b)
table(dfi$Q12b)

#q13b in Japan: Scandal in Japan more important?
dfj$q13b[dfj$q13b == 3] <-0
dfj$q13b[dfj$q13b == 2] <--1
dfj$q13b[dfj$q13b == 1] <-1
table(dfj$q13b)
#q13a in Japan: Scandal in Israel more important?
dfj$q13a[dfj$q13a == 3] <-0
dfj$q13a[dfj$q13a == 2] <--1
dfj$q13a[dfj$q13a == 1] <-1
#q13a in Israel: Scandal in Israel more important?
table(dfj$q13a)
dfi$Q13b[dfi$Q13b == 3] <-0
dfi$Q13b[dfi$Q13b == 2] <--1
dfi$Q13b[dfi$Q13b == 1] <-1
#q13b in Israel: Scandal in Japan more important?
table(dfi$Q13b)
dfi$Q13a[dfi$Q13a == 3] <-0
dfi$Q13a[dfi$Q13a == 2] <--1
dfi$Q13a[dfi$Q13a == 1] <-1
table(dfi$Q13a)

#q15b in Japan: Do you support Japanese preemption?
dfj <- dfj %>%
  mutate(q15b = 4 - q15b)
table(dfj$q15b)
#q15a in Japan: Do you support Israel or Iran?
dfj <- dfj %>%
  mutate(q15a = 4 - q15a)
table(dfj$q15a)

#q15a in Israel: Do you support Israeli preemption?
dfi <- dfi %>%
  mutate(Q15a = 4 - Q15a)
table(dfi$Q15a)
#q15b in Israeli: Do you support Japanese preemption?
dfi <- dfi %>%
  mutate(Q15b = 4 - Q15b)
table(dfi$Q15b)

#q16a in Japan: Do you support Japanese nuke possession?
dfj <- dfj %>%
  mutate(q16b = 4 - q16b)
table(dfj$q16b)
#q16b in Japan: Do you support Israeli nuke possession?
dfj <- dfj %>%
  mutate(q16a = 4 - q16a)
table(dfj$q16a)
#q16a in Israel: Do you support Israeli nuke possession?
dfi <- dfi %>%
  mutate(Q16a = 4 - Q16a)
table(dfi$Q16a)
#q16b in Israel: Do you support Japanese nuke possession?
dfi <- dfi %>%
  mutate(Q16b = 4 - Q16b)
table(dfi$Q16b)

```

```{r hist, include=TRUE}

hist(dfj$q04, breaks=seq(0,6,1), main="Japan: Is the Prime Minister Corrupt or Not? (0:yes, 5:no, 6:dnk)", xlab=" ", ylim=c(0,1200))
hist(dfi$Q4, breaks=seq(0,6,1), main="Israel: Is the Prime Minister Corrupt or Not? (0:yes, 5:no, 6:dnk)", xlab=" ", ylim=c(0,1200))
```



## Setting pattern vers.
```{r, echo=FALSE, message=F}
dfjb <- dfj %>% filter(pat == 2 | pat == 4 |pat == 5 |pat == 6)

dfjb$pat[dfjb$pat == 2] <-1   #RationalMad
dfjb$pat[dfjb$pat == 4] <-2   #IrrationalMad
dfjb$pat[dfjb$pat == 5] <-3   #HighThreat
dfjb$pat[dfjb$pat == 6] <-4   #LowThreat

dfib <- dfi %>% filter(pat == 1 | pat == 3 |pat == 5 |pat == 6)

dfib$pat[dfib$pat == 1] <-1   #RationalMad
dfib$pat[dfib$pat == 3] <-2   #IrrationalMad
dfib$pat[dfib$pat == 5] <-3   #HighThreat
dfib$pat[dfib$pat == 6] <-4   #LowThreat

dfjc <- dfj %>% filter(pat == 1 | pat == 3)

dfjc$pat[dfjc$pat == 1] <-1   #RationalMad
dfjc$pat[dfjc$pat == 3] <-2   #IrrationalMad

dfic <- dfi %>% filter(pat == 2 | pat == 4)

dfic$pat[dfic$pat == 2] <-1   #RationalMad
dfic$pat[dfic$pat == 4] <-2   #IrrationalMad


```


## Analysis PM support

Comparison of the means:

```{r jpn01, echo=FALSE}
support_jp <- dfjb %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q12b, na.rm = TRUE),
    support_upper = mean(q12b, na.rm = TRUE) + 1.96 * sd(q12b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q12b, na.rm = TRUE) - 1.96 * sd(q12b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  labs( x= "JAPAN",  y = "") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +
  annotate("text", x=1.475, y=0.45, label="(<0.001)***") +
  annotate("text", x=2.475, y=0.90, label="(<0.001)***") +
  annotate("text", x=2.475, y=2.75, label="(<0.001)***") +
  annotate("text", x=2.475, y=1.90, label="(<0.001)***") +
  annotate("text", x=3.425, y=0.90, label="(<0.001)***") +
  annotate("segment", x=0.95, xend=0.95, y=0.58,yend=1.2) +
  annotate("segment", x=0.95, xend=4.05, y=0.58,yend=0.58) +
  annotate("segment", x=4.05, xend=4.05, y=0.58,yend=0.8) +
  annotate("segment", x=1.95, xend=1.95, y=2.5,yend=1.6) +
  annotate("segment", x=1.95, xend=4, y=2.5,yend=2.5) +
  annotate("segment", x=4, xend=4, y=2.5,yend=1.2) +
  annotate("segment", x=2.05, xend=2.05, y=2.15,yend=1.6) +
  annotate("segment", x=2.05, xend=3, y=2.15,yend=2.15) +
  annotate("segment", x=3, xend=3, y=2.15,yend=2.00) +
  annotate("segment", x=1.05, xend=1.05, y=1.2,yend=0.7) +
  annotate("segment", x=1.05, xend=2.95, y=0.7,yend=0.7) +
  annotate("segment", x=2.95, xend=2.95, y=0.7,yend=1.65) +
  annotate("segment", x=3.05, xend=3.05, y=0.7,yend=1.65) +
  annotate("segment", x=3.05, xend=3.95, y=0.7,yend=0.7) +
  annotate("segment", x=3.95, xend=3.95, y=0.7,yend=0.8) +
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Japanese Prime Minister (Lowest:0/Highest:3)")
```

T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfjb$pat),q12b=dfjb$q12b)
res1 <- aov(q12b~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

japan_pat1pat2 <- dfjb %>% filter(pat == 1 | pat == 2)
summary(aov(q12b  ~ factor(pat), data = japan_pat1pat2))

japan_pat1pat3 <- dfjb %>% filter(pat == 1 | pat == 3) 
summary(aov(q12b  ~ factor(pat), data = japan_pat1pat3))

japan_pat1pat4 <- dfjb %>% filter(pat == 1 | pat == 4) 
summary(aov(q12b  ~ factor(pat), data = japan_pat1pat4))

japan_pat2pat3 <- dfjb %>% filter(pat == 2 | pat == 3) 
summary(aov(q12b  ~ factor(pat), data = japan_pat2pat3))

japan_pat2pat4 <- dfjb %>% filter(pat == 2 | pat == 4) 
summary(aov(q12b  ~ factor(pat), data = japan_pat2pat4))

japan_pat3pat4 <- dfjb %>% filter(pat == 3 | pat == 4) 
summary(aov(q12b  ~ factor(pat), data = japan_pat3pat4))

```



Comparison of the means:

```{r isr01, echo=FALSE}
support_isr <- dfib %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q12a, na.rm = TRUE),
    support_upper = mean(Q12a, na.rm = TRUE) + 1.96 * sd(Q12a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q12a, na.rm = TRUE) - 1.96 * sd(Q12a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Israel")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  annotate("text", x=1.475, y=0.45, label="(<0.001)***") +
  annotate("text", x=2.475, y=2.75, label="(0.002)***") +
  annotate("text", x=3.425, y=0.90, label="(<0.001)***") +
  annotate("segment", x=0.95, xend=0.95, y=0.58,yend=1.7) +
  annotate("segment", x=0.95, xend=4.05, y=0.58,yend=0.58) +
  annotate("segment", x=4.05, xend=4.05, y=0.58,yend=1.45) +
  annotate("segment", x=2, xend=2, y=2.5,yend=2.1) +
  annotate("segment", x=2, xend=4, y=2.5,yend=2.5) +
  annotate("segment", x=4, xend=4, y=2.5,yend=1.8) +
  annotate("segment", x=3.05, xend=3.05, y=0.7,yend=1.7) +
  annotate("segment", x=3.05, xend=3.95, y=0.7,yend=0.7) +
  annotate("segment", x=3.95, xend=3.95, y=0.7,yend=1.45) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Israeli Prime Minister (Lowest:0/Highest:3)")

```

T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfib$pat),q12a=dfib$Q12a)
res1 <- aov(q12a~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

isr_pat1pat2 <- dfib %>% filter(pat == 1 | pat == 2)
summary(aov(Q12a  ~ factor(pat), data = isr_pat1pat2))

isr_pat1pat3 <- dfib %>% filter(pat == 1 | pat == 3) 
summary(aov(Q12a  ~ factor(pat), data = isr_pat1pat3))

isr_pat1pat4 <- dfib %>% filter(pat == 1 | pat == 4) 
summary(aov(Q12a  ~ factor(pat), data = isr_pat1pat4))

isr_pat2pat3 <- dfib %>% filter(pat == 2 | pat == 3) 
summary(aov(Q12a  ~ factor(pat), data = isr_pat2pat3))

isr_pat2pat4 <- dfib %>% filter(pat == 2 | pat == 4) 
summary(aov(Q12a  ~ factor(pat), data = isr_pat2pat4))

isr_pat3pat4 <- dfib %>% filter(pat == 3 | pat == 4) 
summary(aov(Q12a  ~ factor(pat), data = isr_pat3pat4))

```

## Analysis on Importance of Handling Political Scandal

Comparison of the means:

```{r jpn02, echo=FALSE}
support_jp <- dfjb %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q13b, na.rm = TRUE),
    support_upper = mean(q13b, na.rm = TRUE) + 1.96 * sd(q13b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q13b, na.rm = TRUE) - 1.96 * sd(q13b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(-1.0, 1.0, 0.5), limits = c(-1.00, 1.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Political scandal is more important than handling NK: Japan (Lowest:-1/Highest:1)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfjb$pat),q13b=dfjb$q13b)
res1 <- aov(q13b~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

japan_pat1pat2 <- dfjb %>% filter(pat == 1 | pat == 2)
summary(aov(q13b  ~ factor(pat), data = japan_pat1pat2))

japan_pat1pat3 <- dfjb %>% filter(pat == 1 | pat == 3) 
summary(aov(q13b  ~ factor(pat), data = japan_pat1pat3))

japan_pat1pat4 <- dfjb %>% filter(pat == 1 | pat == 4) 
summary(aov(q13b  ~ factor(pat), data = japan_pat1pat4))

japan_pat2pat3 <- dfjb %>% filter(pat == 2 | pat == 3) 
summary(aov(q13b  ~ factor(pat), data = japan_pat2pat3))

japan_pat2pat4 <- dfjb %>% filter(pat == 2 | pat == 4) 
summary(aov(q13b  ~ factor(pat), data = japan_pat2pat4))

japan_pat3pat4 <- dfjb %>% filter(pat == 3 | pat == 4) 
summary(aov(q13b  ~ factor(pat), data = japan_pat3pat4))

```


Comparison of the means:

```{r isr02, echo=FALSE}
support_isr <- dfib %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q13a, na.rm = TRUE),
    support_upper = mean(Q13a, na.rm = TRUE) + 1.96 * sd(Q13a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q13a, na.rm = TRUE) - 1.96 * sd(Q13a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Israel")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(-1.0, 1.0, 0.5), limits = c(-1.00, 1.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Political scandal is more important than handling Iran: Israel (Lowest:-1/Highest:1)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfib$pat),q13a=dfib$Q13a)
res1 <- aov(q13a~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

isr_pat1pat2 <- dfib %>% filter(pat == 1 | pat == 2)
summary(aov(Q13a  ~ factor(pat), data = isr_pat1pat2))

isr_pat1pat3 <- dfib %>% filter(pat == 1 | pat == 3) 
summary(aov(Q13a  ~ factor(pat), data = isr_pat1pat3))

isr_pat1pat4 <- dfib %>% filter(pat == 1 | pat == 4) 
summary(aov(Q13a  ~ factor(pat), data = isr_pat1pat4))

isr_pat2pat3 <- dfib %>% filter(pat == 2 | pat == 3) 
summary(aov(Q13a  ~ factor(pat), data = isr_pat2pat3))

isr_pat2pat4 <- dfib %>% filter(pat == 2 | pat == 4) 
summary(aov(Q13a  ~ factor(pat), data = isr_pat2pat4))

isr_pat3pat4 <- dfib %>% filter(pat == 3 | pat == 4) 
summary(aov(Q13a  ~ factor(pat), data = isr_pat3pat4))

```


## Analysis Support for Preemptive Attack 

Comparison of the means:

```{r jpn03, echo=FALSE}
support_jp <- dfjb %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q15b, na.rm = TRUE),
    support_upper = mean(q15b, na.rm = TRUE) + 1.96 * sd(q15b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q15b, na.rm = TRUE) - 1.96 * sd(q15b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0.0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  annotate("text", x=1.475, y=0.45, label="(0.09)*") +
  annotate("text", x=2.475, y=2.85, label="(0.07)*") +
  annotate("text", x=2.475, y=0.85, label="(0.004)***") +
  annotate("text", x=1.775, y=2.3, label="(0.002)***") +
  annotate("segment", x=1, xend=1, y=0.58,yend=1.05) +
  annotate("segment", x=1, xend=3.05, y=0.58,yend=0.58) +
  annotate("segment", x=3.05, xend=3.05, y=0.58,yend=1.25) +
  annotate("segment", x=0.95, xend=0.95, y=2.7,yend=1.45) +
  annotate("segment", x=0.95, xend=4.05, y=2.7,yend=2.7) +
  annotate("segment", x=4.05, xend=4.05, y=2.7,yend=1.65) +
  annotate("segment", x=2., xend=2., y=0.7,yend=1.00) +
  annotate("segment", x=2., xend=3, y=0.7,yend=0.7) +
  annotate("segment", x=3, xend=3, y=0.7,yend=1.25) +
  annotate("segment", x=2, xend=2, y=2.5,yend=1.45) +
  annotate("segment", x=2, xend=4, y=2.5,yend=2.5) +
  annotate("segment", x=4, xend=4, y=2.5,yend=1.65) +
    theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Preemptive Attack against NK: Japan (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfjb$pat),q15b=dfjb$q15b)
res1 <- aov(q15b~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

japan_pat1pat2 <- dfjb %>% filter(pat == 1 | pat == 2)
summary(aov(q15b  ~ factor(pat), data = japan_pat1pat2))

japan_pat1pat3 <- dfjb %>% filter(pat == 1 | pat == 3) 
summary(aov(q15b  ~ factor(pat), data = japan_pat1pat3))

japan_pat1pat4 <- dfjb %>% filter(pat == 1 | pat == 4) 
summary(aov(q15b  ~ factor(pat), data = japan_pat1pat4))

japan_pat2pat3 <- dfjb %>% filter(pat == 2 | pat == 3) 
summary(aov(q15b  ~ factor(pat), data = japan_pat2pat3))

japan_pat2pat4 <- dfjb %>% filter(pat == 2 | pat == 4) 
summary(aov(q15b  ~ factor(pat), data = japan_pat2pat4))

japan_pat3pat4 <- dfjb %>% filter(pat == 3 | pat == 4) 
summary(aov(q15b  ~ factor(pat), data = japan_pat3pat4))

```

Comparison of the means:

```{r isr03, echo=FALSE}
support_isr <- dfib %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q15a, na.rm = TRUE),
    support_upper = mean(Q15a, na.rm = TRUE) + 1.96 * sd(Q15a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q15a, na.rm = TRUE) - 1.96 * sd(Q15a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Israel")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0.0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Preemptive Attack against Iran: Israel (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfib$pat),q15a=dfib$Q15a)
res1 <- aov(q15a~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

isr_pat1pat2 <- dfib %>% filter(pat == 1 | pat == 2)
summary(aov(Q15a  ~ factor(pat), data = isr_pat1pat2))

isr_pat1pat3 <- dfib %>% filter(pat == 1 | pat == 3) 
summary(aov(Q15a  ~ factor(pat), data = isr_pat1pat3))

isr_pat1pat4 <- dfib %>% filter(pat == 1 | pat == 4) 
summary(aov(Q15a  ~ factor(pat), data = isr_pat1pat4))

isr_pat2pat3 <- dfib %>% filter(pat == 2 | pat == 3) 
summary(aov(Q15a  ~ factor(pat), data = isr_pat2pat3))

isr_pat2pat4 <- dfib %>% filter(pat == 2 | pat == 4) 
summary(aov(Q15a  ~ factor(pat), data = isr_pat2pat4))

isr_pat3pat4 <- dfib %>% filter(pat == 3 | pat == 4) 
summary(aov(Q15a  ~ factor(pat), data = isr_pat3pat4))

```

## Analysis Support for Possession of Nuclear Weapons 

Comparison of the means:

```{r jpn04, echo=FALSE}
support_jp <- dfjb %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q16b, na.rm = TRUE),
    support_upper = mean(q16b, na.rm = TRUE) + 1.96 * sd(q16b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q16b, na.rm = TRUE) - 1.96 * sd(q16b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0.0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  annotate("text", x=3., y=2.5, label="(0.02)***") +
  annotate("segment", x=2, xend=2, y=2.7,yend=1.2) +
  annotate("segment", x=2, xend=4, y=2.7,yend=2.7) +
  annotate("segment", x=4, xend=4, y=2.7,yend=1.3) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Possession of Nuclear Weapons: Japan (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfjb$pat),q16b=dfjb$q16b)
res1 <- aov(q16b~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

japan_pat1pat2 <- dfjb %>% filter(pat == 1 | pat == 2)
summary(aov(q16b  ~ factor(pat), data = japan_pat1pat2))

japan_pat1pat3 <- dfjb %>% filter(pat == 1 | pat == 3) 
summary(aov(q16b  ~ factor(pat), data = japan_pat1pat3))

japan_pat1pat4 <- dfjb %>% filter(pat == 1 | pat == 4) 
summary(aov(q16b  ~ factor(pat), data = japan_pat1pat4))

japan_pat2pat3 <- dfjb %>% filter(pat == 2 | pat == 3) 
summary(aov(q16b  ~ factor(pat), data = japan_pat2pat3))

japan_pat2pat4 <- dfjb %>% filter(pat == 2 | pat == 4) 
summary(aov(q16b  ~ factor(pat), data = japan_pat2pat4))

japan_pat3pat4 <- dfjb %>% filter(pat == 3 | pat == 4) 
summary(aov(q16b  ~ factor(pat), data = japan_pat3pat4))

```

Comparison of the means:

```{r isr04, echo=FALSE}
support_isr <- dfib %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q16a, na.rm = TRUE),
    support_upper = mean(Q16a, na.rm = TRUE) + 1.96 * sd(Q16a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q16a, na.rm = TRUE) - 1.96 * sd(Q16a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Israel")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat",
                              "3" = "High Threat",
                              "4" = "Low Threat")) +
  scale_y_continuous(breaks = seq(0.0, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Support for Possession of Nuclear Weapons: Israel (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
Pd <- data.frame(pattn=factor(dfib$pat),q16a=dfib$Q16a)
res1 <- aov(q16a~pattn,data=Pd)
testoutcome <- glht(res1, linfct = mcp(pattn = "Tukey"))
summary(testoutcome) 

isr_pat1pat2 <- dfib %>% filter(pat == 1 | pat == 2)
summary(aov(Q16a  ~ factor(pat), data = isr_pat1pat2))

isr_pat1pat3 <- dfib %>% filter(pat == 1 | pat == 3) 
summary(aov(Q16a  ~ factor(pat), data = isr_pat1pat3))

isr_pat1pat4 <- dfib %>% filter(pat == 1 | pat == 4) 
summary(aov(Q16a  ~ factor(pat), data = isr_pat1pat4))

isr_pat2pat3 <- dfib %>% filter(pat == 2 | pat == 3) 
summary(aov(Q16a  ~ factor(pat), data = isr_pat2pat3))

isr_pat2pat4 <- dfib %>% filter(pat == 2 | pat == 4) 
summary(aov(Q16a  ~ factor(pat), data = isr_pat2pat4))

isr_pat3pat4 <- dfib %>% filter(pat == 3 | pat == 4) 
summary(aov(Q16a  ~ factor(pat), data = isr_pat3pat4))

```




```{r, echo=FALSE}
support_jp <- dfjc %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q13a, na.rm = TRUE),
    support_upper = mean(q13a, na.rm = TRUE) + 1.96 * sd(q13a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q13a, na.rm = TRUE) - 1.96 * sd(q13a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(-1.0, 1.0, 0.5), limits = c(-1.00, 1.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Israeli Pol. scandal is more important than handling Iran: Japan (Lowest:-1/Highest:1)")

```
T-test 
```{r, comment=""}
japan_pat1pat2 <- dfjc %>% filter(pat == 1 | pat == 2)
summary(aov(q13a  ~ factor(pat), data = japan_pat1pat2))
```

```{r, echo=FALSE}
support_isr <- dfic %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q13b, na.rm = TRUE),
    support_upper = mean(Q13b, na.rm = TRUE) + 1.96 * sd(Q13b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q13b, na.rm = TRUE) - 1.96 * sd(Q13b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(-1.0, 1.0, 0.5), limits = c(-1.00, 1.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Japanese Pol. scandal is more important than handling NK: Israel (Lowest:-1/Highest:1)")

```
T-test 
```{r, comment=""}
isr_pat1pat2 <- dfic %>% filter(pat == 1 | pat == 2)
summary(aov(Q13b  ~ factor(pat), data = isr_pat1pat2))
```


```{r, echo=FALSE}
support_jp <- dfjc %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q12a, na.rm = TRUE),
    support_upper = mean(q12a, na.rm = TRUE) + 1.96 * sd(q12a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q12a, na.rm = TRUE) - 1.96 * sd(q12a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Israeli PM: Japan (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
japan_pat1pat2 <- dfjc %>% filter(pat == 1 | pat == 2)
summary(aov(q12a  ~ factor(pat), data = japan_pat1pat2))
```

```{r, echo=FALSE}
support_isr <- dfic %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q12b, na.rm = TRUE),
    support_upper = mean(Q12b, na.rm = TRUE) + 1.96 * sd(Q12b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q12b, na.rm = TRUE) - 1.96 * sd(Q12b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Japanese PM: Israel (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
isr_pat1pat2 <- dfic %>% filter(pat == 1 | pat == 2)
summary(aov(Q12b  ~ factor(pat), data = isr_pat1pat2))
```


```{r, echo=FALSE}
support_jp <- dfjc %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q15a, na.rm = TRUE),
    support_upper = mean(q15a, na.rm = TRUE) + 1.96 * sd(q15a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q15a, na.rm = TRUE) - 1.96 * sd(q15a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Israeli Preemption?: Japan (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
japan_pat1pat2 <- dfjc %>% filter(pat == 1 | pat == 2)
summary(aov(q15a  ~ factor(pat), data = japan_pat1pat2))
```

```{r, echo=FALSE}
support_isr <- dfic %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q15b, na.rm = TRUE),
    support_upper = mean(Q15b, na.rm = TRUE) + 1.96 * sd(Q15b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q15b, na.rm = TRUE) - 1.96 * sd(Q15b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Japanese Preemption?: Israel (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
isr_pat1pat2 <- dfic %>% filter(pat == 1 | pat == 2)
summary(aov(Q15b  ~ factor(pat), data = isr_pat1pat2))
```


```{r, echo=FALSE}
support_jp <- dfjc %>% group_by(pat) %>%
  summarise(
    support_mean = mean(q16a, na.rm = TRUE),
    support_upper = mean(q16a, na.rm = TRUE) + 1.96 * sd(q16a, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(q16a, na.rm = TRUE) - 1.96 * sd(q16a, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_jp %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Israeli Nuclear Possession?: Japan (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
japan_pat1pat2 <- dfjc %>% filter(pat == 1 | pat == 2)
summary(aov(q16a  ~ factor(pat), data = japan_pat1pat2))
```

```{r, echo=FALSE}
support_isr <- dfic %>% group_by(pat) %>%
  summarise(
    support_mean = mean(Q16b, na.rm = TRUE),
    support_upper = mean(Q16b, na.rm = TRUE) + 1.96 * sd(Q16b, na.rm = TRUE) / sqrt(n()),
    support_lower = mean(Q16b, na.rm = TRUE) - 1.96 * sd(Q16b, na.rm = TRUE) / sqrt(n())
  ) %>% mutate(pat = pat, country = "Japan")

support_isr %>% ggplot(aes(as.character(pat), support_mean, label = round(support_mean, 2))) +
  geom_point() +
  geom_text(vjust = 0.5, hjust = -0.2, show.legend = FALSE, size = 3.5) + 
  geom_errorbar(aes(ymin = support_lower, ymax = support_upper), width = 0.1) +
  #labs( x= "",  y = "Rate") +
  scale_x_discrete(labels = c("1" = "Rational\nPreemption\nHigh Threat",
                              "2" = "Irrational\nPreemption\nHigh Threat")) +
  scale_y_continuous(breaks = seq(0.00, 3.0, 0.5), limits = c(0.00, 3.00)) +
  theme_bw() +  #  theme_bw(base_family = "HiraKakuProN-W3") 
  theme(axis.text.x = element_text(size = 10, colour="black")) + 
  theme(axis.text.y = element_text(size = 9, colour="black")) + 
  theme(axis.title = element_blank())  + 
  ggtitle("Fig. Do you support Japanese Nuclear Possession?: Israel (Lowest:0/Highest:3)")

```
T-test 
```{r, comment=""}
isr_pat1pat2 <- dfic %>% filter(pat == 1 | pat == 2)
summary(aov(Q16b  ~ factor(pat), data = isr_pat1pat2))
```
